package com.kc.sjwh.entity.vo.table;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 表格的tr
 * ClassName: Tr
 * date: 2017年5月3日 下午4:39:05
 * @author zhangGuihua(hua7381@163.com)
 */
public class Tr implements Serializable{
	List<Cell> cells = new ArrayList<Cell>();
	
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<tr>");
		for(Cell cell : cells) {
			if(cell.getShow()) {
				sb.append(cell.toString());
			}
		}
		sb.append("</tr>");
		return sb.toString();
	}
	
	public Tr() {
		
	}
	
	public Tr(Cell... cells) {
		for(Cell cell : cells) {
			this.cells.add(cell);
		}
	}
	
	public Tr(String... ths) {
		for(String th : ths) {
			this.cells.add(new Th(th));
		}
	}
	
	public void add(Cell cell) {
		cells.add(cell);
	}
	
	public List<Cell> getCells() {
		return cells;
	}
	public void setCells(List<Cell> cells) {
		this.cells = cells;
	}
}